module.exports = class extends think.Controller {
  async indexAction () { // 检查版本
    var db = this.mongoose('mongoose/version')
    this.post().time = Date.now()
    this.post().files = JSON.parse(this.post().files)
    try {
      console.log(this.post())
      var data = new db (this.post())
      await data.save()
      this.json({
        status: 1,
        version: this.post().version,
        type: this.post().type,
        url: this.post().files
      })
    } catch (err) {
      this.ctx.fail( 1000, err.message)
    }
  }
}